# Maintainer: Antonio Rojas <arojas@archlinux.org>

_pyname=jupyter_packaging
pkgname=python-${_pyname/_/-}
pkgver=0.12.3
pkgrel=4
pkgdesc='Jupyter Packaging Utilities'
arch=(any)
url='https://jupyter.org/'
license=(custom)
depends=(python-deprecation python-wheel python-tomlkit python-packaging python-setuptools)
makedepends=(python-build python-installer python-hatchling)
checkdepends=(python-pytest-mock python-pytest-timeout)
conflicts=(python-$_pyname)
provides=(python-$_pyname)
replaces=(python-$_pyname)
source=(https://pypi.io/packages/source/j/$_pyname/$_pyname-$pkgver.tar.gz)
sha256sums=('9d9b2b63b97ffd67a8bc5391c32a421bc415b264a32c99e4d8d8dd31daae9cf4')

build() {
  cd $_pyname-$pkgver
  python -m build --wheel --no-isolation
}

check() {
  cd $_pyname-$pkgver
  pytest -v -W ignore::DeprecationWarning
}

package() {
  cd $_pyname-$pkgver
  python -m installer --destdir="$pkgdir" dist/*.whl

  install -Dm644 LICENSE -t "$pkgdir"/usr/share/licenses/$pkgname
}
